<?php
//Author:炳南
//Data:2016-2-27

require 'basehandle.php';
require '../dao/alldao.php';

class Mission implements basehandle{
	public function dohandle(){
		$simg=$_POST['simg'];
		$userid=$_POST['userid'];
		$dao=new alldao();
 		$rs=$dao->mission($simg,$userid);
 		//error_log($rs);
		if(!empty($rs)){
			$info=array(array("mid"=>$rs[0]['mid'],"mimg"=>$rs[0]['mimg'],
			"mlevel"=>$rs[0]['mle'],"playmap"=>$rs[0]['mpm'],
			"mjinbi"=>$rs[0]['mjb'],"umid"=>$rs[0]['misionid']),
			array("mid"=>$rs[1]['mid'],"mimg"=>$rs[1]['mimg'],
			"mlevel"=>$rs[1]['mle'],"playmap"=>$rs[1]['mpm'],
			"mjinbi"=>$rs[1]['mjb'],"umid"=>$rs[1]['misionid']),
			array("mid"=>$rs[2]['mid'],"mimg"=>$rs[2]['mimg'],
			"mlevel"=>$rs[2]['mle'],"playmap"=>$rs[2]['mpm'],
			"mjinbi"=>$rs[2]['mjb'],"umid"=>$rs[2]['misionid']),
			array("mid"=>$rs[3]['mid'],"mimg"=>$rs[3]['mimg'],
			"mlevel"=>$rs[3]['mle'],"playmap"=>$rs[3]['mpm'],
			"mjinbi"=>$rs[3]['mjb'],"umid"=>$rs[3]['misionid']));
		}
		else{
			$info=array("rs"=>"error","errorinf"=>"加载失败");
		}
		echo json_encode($info);
	}
	
}  
?>